'''

'''


class Lyric:
    def __init__(self):
        self._time = 0
        self.word = ''

    @property
    def time(self):
        return self.time
    @time.setter
    def time(self,value):
        m = float(value[1:3])
        s = float(value[4:])
        self.time = m*60+s
    def __repr__(self):
        return '{}:{}'.format(self.time,self.word)


class LyricAnalysis:

    def __init__(self, song_name):
        self.__song_name = song_name
        self.__lyrics = []



    def analysis_file(self):
        with open('files/' + self.__song_name + '.lrc', 'r', encoding='utf-8') as rs:
            while 1:
                line_content = rs.readline()
                if not line_content:
                    break
                # print(line_content)
                lines = line_content.split(']')
                word = lines[-1]
                for time in lines[:-1]:
                    lyric = Lyric()
                    lyric.time = time
                    lyric.word = word
                    self.__lyrics.append(lyric)
        print(self.__lyrics)
        self.__lyrics.sort(reverse=True)

s1 = LyricAnalysis('蓝莲花')
s1.analysis_file()
